package com.itheima.d7_commons_io;

import java.io.Serial;
import java.io.Serializable;

public class Hero implements Serializable {
    @Serial
    private static final long serialVersionUID = -6914205206903135113L;
    private String name;
    private int life;
    private int ganta;
    private int xiaoguo;
    private  double score;

    public Hero() {
    }

    public Hero(String name, int life, int ganta, int xiaoguo) {
        this.name = name;
        this.life = life;
        this.ganta = ganta;
        this.xiaoguo = xiaoguo;
        this.score = life*0.5+xiaoguo*0.2+xiaoguo*0.3;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getLife() {
        return life;
    }

    public void setLife(int life) {
        this.life = life;
    }

    public int getGanta() {
        return ganta;
    }

    public void setGanta(int ganta) {
        this.ganta = ganta;
    }

    public int getXiaoguo() {
        return xiaoguo;
    }

    public void setXiaoguo(int xiaoguo) {
        this.xiaoguo = xiaoguo;
    }

    public double getScore() {
        return score;
    }

    public void setScore(double score) {
        this.score = score;
    }

    @Override
    public String toString() {
        return "Hero{" +
                "name='" + name + '\'' +
                ", life=" + life +
                ", ganta=" + ganta +
                ", xiaoguo=" + xiaoguo +
                ", score=" + score +
                '}';
    }



}
